package com.example.yupao_project.component;

import com.example.yupao_project.entity.User;
import org.springframework.stereotype.Component;

/**
 * 判断是否为管理员
 * @author: 杰
 * @date: 2024/5/7 11:30
 */
@Component
public class IsAdmin {
    public boolean isAdmin(User user) {
        return user.getUserRole() == 1;
    }
}
